<!DOCTYPE html>
<!-- saved from url=(0054)https://getbootstrap.com/docs/4.0/examples/dashboard/# -->
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <meta name="description" content="">
    <meta name="author" content="">
    <link rel="icon" href="https://getbootstrap.com/docs/4.0/assets/img/favicons/favicon.ico">

    <title>员工列表</title>

    <link rel="canonical" href="https://getbootstrap.com/docs/4.0/examples/dashboard/">

    <!-- Bootstrap core CSS -->
    <link th:href="@{css/bootstrap.min.css}" rel="stylesheet">

    <!-- Custom styles for this template -->
    <link th:href="@{css/dashboard.css}" rel="stylesheet">
</head>

<body>
<!-- 引入通用模板 -->
<div th:replace="~{common/common::topbar}"></div>

<div class="container-fluid">
    <div class="row">

        <!-- 引入通用模板 -->
        <div th:replace="~{common/common::sidebar(active = 'list')}"></div>

        <main role="main" class="col-md-9 ml-sm-auto col-lg-10 pt-3 px-4">
            <h2>
                <!-- 这里使用a标签，不使用button标签，否则不能跳转 -->
                <a class="btn btn-sm btn-success" th:href="@{/employeeAdd}">添加员工</a></h2>
            <div class="table-responsive">
                <table class="table table-striped table-sm">
                    <thead>
                    <tr>
                        <th>编号</th>
                        <th>姓名</th>
                        <th>邮箱</th>
                        <th>性别</th>
                        <th>部门</th>
                        <th>生日</th>
                        <th>编辑</th>
                    </tr>
                    </thead>
                    <tbody>
                    <tr th:each="employee:${employeeList}">
                        <td th:text="${employee.getId()}"></td>
                        <td th:text="${employee.getLastName()}"></td>
                        <td th:text="${employee.getEmail()}"></td>
                        <td th:text="${employee.getGender() == 0 ? '女':'男'}"></td>
                        <td th:text="${employee.getDepartment().getDepartmentName()}"></td>
                        <td th:text="${#dates.format(employee.getBirth(),'yyyy-MM-dd')}"></td>
                        <td>
                            <a class="btn btn-sm btn-primary"
                               th:href="@{/actionEmployeeUpdate(employeeId=${employee.getId()})}">编辑</a>
                            <a class="btn btn-sm btn-danger" th:href="@{/deleteEmployee/(id=${employee.getId()})}">删除</a>
                        </td>
                    </tr>
                    </tbody>

                </table>
            </div>
        </main>
    </div>
</div>

<!-- Bootstrap core JavaScript
================================================== -->
<!-- Placed at the end of the document so the pages load faster -->
<script th:src="@{js/jquery-3.2.1.slim.min.js}"
        integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN"
        crossorigin="anonymous"></script>
<script>window.jQuery || document.write('<script th:src="@{js/jquery-slim.min.js}"><\/script>')</script>
<script th:src="@{js/popper.min.js}"></script>
<script th:src="@{js/bootstrap.min.js}"></script>

<!-- Icons -->
<script th:src="@{js/feather.min.js}"></script>
<script>
    feather.replace()
</script>

<!-- Graphs -->
<script th:src="@{js/Chart.min.js}"></script>
<script>
    var ctx = document.getElementById("myChart");
    var myChart = new Chart(ctx, {
        type: 'line',
        data: {
            labels: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"],
            datasets: [{
                data: [15339, 21345, 18483, 24003, 23489, 24092, 12034],
                lineTension: 0,
                backgroundColor: 'transparent',
                borderColor: '#007bff',
                borderWidth: 4,
                pointBackgroundColor: '#007bff'
            }]
        },
        options: {
            scales: {
                yAxes: [{
                    ticks: {
                        beginAtZero: false
                    }
                }]
            },
            legend: {
                display: false,
            }
        }
    });
</script>


</body>
</html>